﻿
namespace Marmat.Forms.Views
{
    namespace Grid
    {
        public class FocusedRowChangedEventArgs
        {
            internal DevExpress.XtraGrid.Views.Base.BaseView sender;
            internal DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs info;

            internal FocusedRowChangedEventArgs(DevExpress.XtraGrid.Views.Base.BaseView sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs info)
            {
                this.info = info;
                this.sender = sender;
            }

            /// <summary>
            /// 获取当前焦点行的行号。
            /// </summary>
            /// <value></value>
            /// <returns></returns>
            /// <remarks></remarks>
            public int FocusedRowHandle
            {
                get
                {
                    return this.info.FocusedRowHandle;
                }
            }

            /// <summary>
            /// 获取上一个焦点行的行号。
            /// </summary>
            /// <value></value>
            /// <returns></returns>
            /// <remarks></remarks>
            public int PrevFocusedRowHandle
            {
                get
                {
                    return this.info.PrevFocusedRowHandle;
                }
            }

            public object Row
            {
                get
                {
                    return this.sender.GetRow(this.FocusedRowHandle);
                }
            }

            public BaseGrid GridControl
            {
                get
                {
                    return this._GridControl;
                }
            }

            internal BaseGrid _GridControl;
        }
    }
}